import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'


const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 导入全局 axios
import api from './api/index'
// 将封装好的 后端接口 请求对象 设置为 app的 全局属性
app.config.globalProperties.$api = api

app.use(ElementPlus, {
    locale: zhCn,
})

app.use(store).use(router).use(ElementPlus).mount('#app')